[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
A_DEL()
Delete one element from an array
-------------------------------------------------------------------------------
Syntax
A_DEL( <aTarget>, [<idxPos>], [<nCount>] )
Arguments
<aTarget> is the array from which an element will be deleted.
<idxPos> is the position in the target array of the element to be
deleted.
<nCount> is the number of elements to shift. The default is all
elements starting at <idxPos> until the end of the array.
Returns
None.
Description
A_DEL() is similar to Clipper's ADEL() function. The array element
pointed to by <idxPos> is removed and <nCount> elements are
shifted up one position. A blank element is inserted at the
position created by the shift and filled with the default value
based on the type of the array (see A_DECLARE()).
FlexFile's multi-dimensional arrays are not nested single
dimensional arrays. Therefore, A_DEL()eting an element has no
other affect than shifting <nCount> elements up one position.
Wrapping will occur if <nCount> goes beyond the current row
pointed to by <idxPos>. For example, if you have a two dimensional
array with accounts in the first dimension and 12 prior period
amounts in the second dimension, and you wanted to operate on the
first quarter (i.e. 3 periods), making <nCount> three times the
number of accounts will "wrap" around three periods. See the
discussion on arrays in chapter 2 for more information on this
feature.
Examples
// Declare a two dimensional (C)haracter array
LOCAL rows, cols, x, y, z
rows = 10
cols = 20
z = 1
aChar = A_DECLARE( "C", rows, cols )
// Fill the array with increasing character values.
FOR x = 1 to rows
FOR y = 1 to cols
z++
A_STORE( aChar, chr(z), A_( x, y ) )
NEXT
NEXT
// Delete the ASCII character "." from the first element
// and shift all elements from the second element to the
// end of the array up one position. Wrapping will occur.
A_DEL( aChar, A_(1, 1), 1 )
See Also:
A_DECLARE()
A_INS()
A_SCROLL()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson